package com.pine.app.module.security.oauth.exception.analyzer;

import javax.servlet.ServletException;

/**
 * @author xiaoyuan
 * @create 2020/3/16 14:05
 **/
public class DefaultThrowableAnalyzer extends ThrowableAnalyzer    {


    public DefaultThrowableAnalyzer() {
    }

    protected void initExtractorMap() {
        super.initExtractorMap();
        this.registerExtractor(ServletException.class, throwable -> {
            ThrowableAnalyzer.verifyThrowableHierarchy(throwable, ServletException.class);
            return ((ServletException) throwable).getRootCause();
        });
    }
}
